home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / VideoToolbox 96.06.15 / VideoToolboxSources / ATMInterface.3.c < prev    next >
Text File  |  1996-04-08  |  16KB  |  618 lines

  1. /*
  2.  * ATMInterface.c
  3.  *
  4.  * Version 3.0
  5.  *
  6.  * Adobe Type Manager is a trademark of Adobe Systems Incorporated.
  7.  * Copyright 1983-1991 Adobe Systems Incorporated.
  8.  * All Rights Reserved.
  9.  */
  10.  
  11. /* 
  12. NOTE:
  13. ATMInterface.c can be downloaded from:
  14. ftp://ftp.mv.us.adobe.com/pub/adobe/misc/programs/MacATM30headers.sea.hqx
  15. For current documentation of the ATM Macintosh C interface download either:
  16. ftp://ftp.mv.us.adobe.com/pub/adobe/DeveloperSupport/TechNotes/PSfiles/5072.ATM_Adv_Mac.ps
  17. ftp://ftp.mv.us.adobe.com/pub/adobe/DeveloperSupport/TechNotes/PDFfiles/5072.ATM_Adv_Mac.pdf
  18. Or use their web server:
  19. http://www.adobe.com/
  20.  
  21. HISTORY:
  22. 8/94    dgp downloaded it.
  23. 9/7/94    dgp cosmetic editing.
  24. 11/15/94 dgp Asserted, below, that Metrowerks CodeWarrior C can call Pascal routines directly,
  25. since I don't know where to look for the CallPascal() routine that Adobe uses otherwise. This
  26. seems to compile ok, but I haven't tested it.
  27. 11/15/94 dgp did cosmetic editing to eliminate compiler warnings about possibly undesired
  28. assignment within an if condition. Converted a couple old-style function headers to ANSI style.
  29. 4/8/95 dgp updated adobe's ftp addresses. Alas, they still haven't released a ppc-compatible
  30. version of ATMInterface.c.
  31. */
  32. #if __powerc
  33.     #error "This file is not PowerPC compatible. Use ATMInterface.c instead."
  34. /*
  35. This file is fine for 68k compilation, but is likely to crash if compiled for ppc.
  36. The calls to ATM need to be converted to use UniversalProcPtr's, since the ATM code
  37. might be 68k or ppc code, depending on which version of ATM is installed on your PowerPC.
  38. The conversion is straightforward, but tedious. Either use ATMInterface.c, or, if you
  39. need the functionality of this file and Adobe has yet to post a new, universal, version,
  40. then you could convert this file yourself, using ATMInterface.c as a guide. If you do
  41. succeed then please send the happy result to denis@xp.psych.nyu.edu to share with
  42. other users of the VideoToolbox.
  43. */
  44. #endif
  45. #if THINK_C >= 5 || SYMANTEC_C || applec
  46.     #include <Types.h>
  47.     #include <Dialogs.h>
  48.     #include <Files.h>
  49.     #include <Devices.h>
  50.     #if THINK_C
  51.         #include <pascal.h>
  52.     #endif
  53. #endif
  54.  
  55. #if THINK_C >= 5 || SYMANTEC_C || applec || __MWERKS__    /* dgp added CodeWarrior since I can't find CallPascal */
  56.     #define CALL_PASCAL        0                /* can make Pascal calls directly */
  57. #else
  58.     #define CALL_PASCAL        1                /* needs CallPascal() help */
  59. #endif
  60.  
  61. #include "ATMInterface.3.h"
  62.  
  63. #ifndef FALSE
  64.     #define FALSE 0
  65. #endif
  66.  
  67. short            ATMOpen = 0;
  68. short            ATMOpenVersion;
  69. LATEST_PROCS    ATMProcs;
  70.  
  71. short initVersionATM(short version)
  72. {
  73.     CntrlParam c;
  74.     OSErr    err;
  75.     
  76.     ATMOpen = 0;
  77.     
  78.     if (OpenDriver((StringPtr) "\p.ATM", &c.ioCRefNum))
  79.         return 0;
  80.  
  81.     /* Use ATMPascalProcsStatusCode for all routines to use all pascal interfaces. */
  82.     c.csCode = ATMProcsStatusCode;
  83.     ATMProcs.version = version;
  84.     *(ATMProcs5 **) c.csParam = &ATMProcs;
  85.  
  86.     err = PBStatus((ParmBlkPtr) &c, 0);
  87.     if (err)
  88.         return 0;
  89.  
  90.     ATMOpenVersion = version;
  91.     return ATMOpen = 1;
  92. }
  93.  
  94. short initPascalVersionATM(short version)
  95. {
  96.     CntrlParam c;
  97.     OSErr    err;
  98.     
  99.     ATMOpen = 0;
  100.     
  101.     if (OpenDriver((StringPtr) "\p.ATM", &c.ioCRefNum))
  102.         return 0;
  103.  
  104.     /* Use ATMPascalProcsStatusCode for all routines to use all pascal interfaces. */
  105.     c.csCode = ATMPascalProcsStatusCode;
  106.     ATMProcs.version = version;
  107.     *(ATMProcs5 **) c.csParam = &ATMProcs;
  108.  
  109.     err = PBStatus((ParmBlkPtr) &c, 0);
  110.     if (err)
  111.         return 0;
  112.  
  113.     ATMOpenVersion = version;
  114.     return ATMOpen = 1;
  115. }
  116.  
  117. short fontAvailableATM(short family, short style)
  118. {
  119.     return ATMOpen ? (*ATMProcs.fontAvailable)(family, style) : 0;
  120. }
  121.  
  122. short showTextATM(Byte *text, short length, ATMFixedMatrix *matrix)
  123. {
  124.     /* Note: this really is "showText", version 3 style. */
  125.     return (ATMOpen && ATMOpenVersion == ATMProcs3Version) ?
  126.         (*(short (*)(StringPtr , short, ATMFixedMatrix *)) ATMProcs.showTextErr)
  127.             (text, length, matrix) : length;
  128. }
  129.  
  130. short showTextATMErr(Byte *text, short length, ATMFixedMatrix *matrix, short *errorCode)
  131. {
  132.     return (ATMOpen && ATMOpenVersion >= ATMProcs4Version) ? (*ATMProcs.showTextErr)
  133.         ((void *) text, length, matrix, errorCode) : length;
  134. }
  135.  
  136. short xyshowTextATM(Byte *text, short length, ATMFixedMatrix *matrix, ATMFixed *displacements)
  137. {
  138.     /* Note: this really is "xyshowText", version 3 style. */
  139.     return (ATMOpen && ATMOpenVersion == ATMProcs3Version) ?
  140.         (*(short (*)(StringPtr , short, ATMFixedMatrix *, ATMFixed *)) ATMProcs.xyshowTextErr)
  141.             (text, length, matrix, displacements) : length;
  142. }
  143.  
  144. short xyshowTextATMErr(Byte *text, short length, ATMFixedMatrix *matrix,
  145.                     ATMFixed *displacements, short *errorCode)
  146. {
  147.     return (ATMOpen && ATMOpenVersion >= ATMProcs4Version) ? (*ATMProcs.xyshowTextErr)
  148.         ((void *) text, length, matrix, displacements, errorCode) : length;
  149. }
  150.  
  151. short getOutlineATM(
  152.     short c,
  153.     ATMFixedMatrix *matrix, 
  154.     Ptr clientHook,
  155.     short (*MoveTo)(),
  156.     short (*LineTo)(),
  157.     short (*CurveTo)(), 
  158.     short (*ClosePath)())
  159. {
  160.     if (!ATMOpen)
  161.         return ATM_NOT_ON;
  162.     return ATMOpenVersion >= ATMProcs4Version ? 
  163.         (*ATMProcs.getOutline)(c, matrix, clientHook, MoveTo, LineTo, CurveTo, ClosePath) : ATM_WRONG_VERSION;
  164. }                
  165.  
  166. short startFillATM(void)
  167. {
  168.     if (!ATMOpen)
  169.         return ATM_NOT_ON;
  170.     return ATMOpenVersion >= ATMProcs4Version ? 
  171.         (*ATMProcs.startFill)() : ATM_WRONG_VERSION;
  172. }                
  173.  
  174. short fillMoveToATM(ATMPFixedPoint pc)
  175. {
  176.     if (!ATMOpen)
  177.         return ATM_NOT_ON;
  178.     return ATMOpenVersion >= ATMProcs4Version ? 
  179.         (*ATMProcs.fillMoveTo)(pc) : ATM_WRONG_VERSION;
  180. }                
  181.  
  182. short fillLineToATM(ATMPFixedPoint pc)
  183. {
  184.     if (!ATMOpen)
  185.         return ATM_NOT_ON;
  186.     return ATMOpenVersion >= ATMProcs4Version ? 
  187.         (*ATMProcs.fillLineTo)(pc) : ATM_WRONG_VERSION;
  188. }                
  189.  
  190. short fillCurveToATM(ATMPFixedPoint pc1, ATMPFixedPoint pc2, ATMPFixedPoint pc3)
  191. {
  192.     if (!ATMOpen)
  193.         return ATM_NOT_ON;
  194.     return ATMOpenVersion >= ATMProcs4Version ? 
  195.         (*ATMProcs.fillCurveTo)(pc1, pc2, pc3) : ATM_WRONG_VERSION;
  196. }                
  197.  
  198. short fillClosePathATM(void)
  199. {
  200.     if (!ATMOpen)
  201.         return ATM_NOT_ON;
  202.     return ATMOpenVersion >= ATMProcs4Version ? 
  203.         (*ATMProcs.fillClosePath)() : ATM_WRONG_VERSION;
  204. }                
  205.  
  206. short endFillATM(void)
  207. {
  208.     if (!ATMOpen)
  209.         return ATM_NOT_ON;
  210.     return ATMOpenVersion >= ATMProcs4Version ? 
  211.         (*ATMProcs.endFill)() : ATM_WRONG_VERSION;
  212. }                
  213.  
  214. void disableATM(void)
  215. {
  216.     if (!ATMOpen)
  217.         return;
  218.     if (ATMOpenVersion >= ATMProcs5Version) 
  219. #if CALL_PASCAL
  220.         CallPascal(ATMProcs.disable);
  221. #else
  222.         (*ATMProcs.disable)();
  223. #endif
  224. }                
  225.  
  226. void reenableATM(void)
  227. {
  228.     if (!ATMOpen)
  229.         return;
  230.     if (ATMOpenVersion >= ATMProcs5Version) 
  231. #if CALL_PASCAL
  232.         CallPascal(ATMProcs.reenable);
  233. #else
  234.         (*ATMProcs.reenable)();
  235. #endif
  236. }                
  237.  
  238. short getBlendedFontTypeATM(StringPtr fontName, short fondID)
  239. {
  240.     if (!ATMOpen)
  241.         return ATMNotBlendFont;
  242.     return ATMOpenVersion >= ATMProcs5Version ? 
  243. #if CALL_PASCAL
  244.         CallPascalW(fontName, fondID, ATMProcs.getBlendedFontType)
  245. #else
  246.         (*ATMProcs.getBlendedFontType)(fontName, fondID) 
  247. #endif
  248.             : ATMNotBlendFont;
  249. }
  250.  
  251. ATMErr encodeBlendedFontNameATM(StringPtr familyName, short numAxes,
  252.                 Fixed *coords, StringPtr blendName)
  253. {
  254.     if (!ATMOpen)
  255.         return ATM_NOT_ON;
  256.     return ATMOpenVersion >= ATMProcs5Version ? 
  257. #if CALL_PASCAL
  258.         CallPascalW(familyName, numAxes, coords, blendName, ATMProcs.encodeBlendedFontName)
  259. #else
  260.         (*ATMProcs.encodeBlendedFontName)(familyName, numAxes, coords, blendName) 
  261. #endif
  262.             : ATM_WRONG_VERSION;
  263. }
  264.  
  265. ATMErr decodeBlendedFontNameATM(StringPtr blendName, StringPtr familyName,
  266.             short *numAxes, Fixed *coords, StringPtr displayInstanceStr)
  267. {
  268.     if (!ATMOpen)
  269.         return ATM_NOT_ON;
  270.     return ATMOpenVersion >= ATMProcs5Version ? 
  271. #if CALL_PASCAL
  272.         CallPascalW(blendName, familyName, numAxes, coords, displayInstanceStr,
  273.                         ATMProcs.decodeBlendedFontName) 
  274. #else
  275.         (*ATMProcs.decodeBlendedFontName)(blendName, familyName, numAxes, coords, displayInstanceStr) 
  276. #endif
  277.             : ATM_WRONG_VERSION;
  278. }
  279.  
  280. ATMErr    addMacStyleToCoordsATM(Fixed *coords, short macStyle, Fixed *newCoords, short *stylesLeft)
  281. {
  282.     if (!ATMOpen)
  283.         return ATM_NOT_ON;
  284.     return ATMOpenVersion >= ATMProcs5Version ? 
  285. #if CALL_PASCAL
  286.         CallPascalW(coords, macStyle, newCoords, stylesLeft,
  287.                         ATMProcs.addMacStyleToCoords) 
  288. #else
  289.         (*ATMProcs.addMacStyleToCoords)(coords, macStyle, newCoords, stylesLeft) 
  290. #endif
  291.             : ATM_WRONG_VERSION;
  292. }
  293.  
  294. ATMErr convertCoordsToBlendATM(Fixed *coords, Fixed *weightVector)
  295. {
  296.     if (!ATMOpen)
  297.         return ATM_NOT_ON;
  298.     return ATMOpenVersion >= ATMProcs5Version ? 
  299. #if CALL_PASCAL
  300.         CallPascalW(coords, weightVector, ATMProcs.convertCoordsToBlend) 
  301. #else
  302.         (*ATMProcs.convertCoordsToBlend)(coords, weightVector) 
  303. #endif
  304.             : ATM_WRONG_VERSION;
  305. }
  306.  
  307. ATMErr normToUserCoordsATM(Fixed *normalCoords, Fixed *coords)
  308. {
  309.     if (!ATMOpen)
  310.         return ATM_NOT_ON;
  311.     return ATMOpenVersion >= ATMProcs5Version ? 
  312. #if CALL_PASCAL
  313.         CallPascalW(normalCoords, coords, ATMProcs.normToUserCoords) 
  314. #else
  315.         (*ATMProcs.normToUserCoords)(normalCoords, coords) 
  316. #endif
  317.             : ATM_WRONG_VERSION;
  318. }
  319.  
  320. ATMErr userToNormCoordsATM(Fixed *coords, Fixed *normalCoords)
  321. {
  322.     if (!ATMOpen)
  323.         return ATM_NOT_ON;
  324.     return ATMOpenVersion >= ATMProcs5Version ? 
  325. #if CALL_PASCAL
  326.         CallPascalW(coords, normalCoords, ATMProcs.userToNormCoords) 
  327. #else
  328.         (*ATMProcs.userToNormCoords)(coords, normalCoords) 
  329. #endif
  330.             : ATM_WRONG_VERSION;
  331. }
  332.  
  333. ATMErr createTempBlendedFontATM(short numAxes, Fixed *coords, short *useFondID)
  334. {
  335.     if (!ATMOpen)
  336.         return ATM_NOT_ON;
  337.     return ATMOpenVersion >= ATMProcs5Version ? 
  338. #if CALL_PASCAL
  339.         CallPascalW(numAxes, coords, useFondID, ATMProcs.createTempBlendedFont) 
  340. #else
  341.         (*ATMProcs.createTempBlendedFont)(numAxes, coords, useFondID) 
  342. #endif
  343.             : ATM_WRONG_VERSION;
  344. }
  345.  
  346. ATMErr disposeTempBlendedFontATM(short fondID)
  347. {
  348.     if (!ATMOpen)
  349.         return ATM_NOT_ON;
  350.     return ATMOpenVersion >= ATMProcs5Version ? 
  351. #if CALL_PASCAL
  352.         CallPascalW(fondID, ATMProcs.disposeTempBlendedFont) 
  353. #else
  354.         (*ATMProcs.disposeTempBlendedFont)(fondID) 
  355. #endif
  356.             : ATM_WRONG_VERSION;
  357. }
  358.  
  359. ATMErr createPermBlendedFontATM(StringPtr fontName, short fontSize, short fontFileID, short *retFondID)
  360. {
  361.     if (!ATMOpen)
  362.         return ATM_NOT_ON;
  363.     return ATMOpenVersion >= ATMProcs5Version ? 
  364. #if CALL_PASCAL
  365.         CallPascalW(fontName, fontSize, fontFileID, retFondID, ATMProcs.createPermBlendedFont) 
  366. #else
  367.         (*ATMProcs.createPermBlendedFont)(fontName, fontSize, fontFileID, retFondID) 
  368. #endif
  369.             : ATM_WRONG_VERSION;
  370. }
  371.  
  372. ATMErr disposePermBlendedFontATM(short fondID)
  373. {
  374.     if (!ATMOpen)
  375.         return ATM_NOT_ON;
  376.     return ATMOpenVersion >= ATMProcs5Version ? 
  377. #if CALL_PASCAL
  378.         CallPascalW(fondID, ATMProcs.disposePermBlendedFont) 
  379. #else
  380.         (*ATMProcs.disposePermBlendedFont)(fondID) 
  381. #endif
  382.             : ATM_WRONG_VERSION;
  383. }
  384.  
  385. ATMErr getTempBlendedFontFileIDATM(short *fileID)
  386. {
  387.     if (!ATMOpen)
  388.         return ATM_NOT_ON;
  389.     return ATMOpenVersion >= ATMProcs5Version ? 
  390. #if CALL_PASCAL
  391.         CallPascalW(fileID, ATMProcs.getTempBlendedFontFileID) 
  392. #else
  393.         (*ATMProcs.getTempBlendedFontFileID)(fileID) 
  394. #endif
  395.             : ATM_WRONG_VERSION;
  396. }
  397.  
  398. ATMErr getNumAxesATM(short *numAxes)
  399. {
  400.     if (!ATMOpen)
  401.         return ATM_NOT_ON;
  402.     *numAxes = 0;
  403.     return ATMOpenVersion >= ATMProcs5Version ? 
  404. #if CALL_PASCAL
  405.         CallPascalW(numAxes, ATMProcs.getNumAxes)
  406. #else
  407.         (*ATMProcs.getNumAxes)(numAxes) 
  408. #endif
  409.             : ATM_WRONG_VERSION;
  410. }
  411.  
  412. ATMErr getNumMastersATM(short *numMasters)
  413. {
  414.     if (!ATMOpen)
  415.         return ATM_NOT_ON;
  416.     *numMasters = 0;
  417.     return ATMOpenVersion >= ATMProcs5Version ? 
  418. #if CALL_PASCAL
  419.         CallPascalW(numMasters, ATMProcs.getNumMasters)
  420. #else
  421.         (*ATMProcs.getNumMasters)(numMasters)
  422. #endif
  423.             : ATM_WRONG_VERSION;
  424. }
  425.  
  426. ATMErr getMasterFONDATM(short i, short *masterFOND)
  427. {
  428.     if (!ATMOpen)
  429.         return ATM_NOT_ON;
  430.     return ATMOpenVersion >= ATMProcs5Version ? 
  431. #if CALL_PASCAL
  432.         CallPascalW(i, masterFOND, ATMProcs.getMasterFOND) 
  433. #else
  434.         (*ATMProcs.getMasterFOND)(i, masterFOND) 
  435. #endif
  436.             : 0;
  437. }
  438.  
  439. ATMErr copyFitATM(short method, Fixed TargetWidth, Fixed *beginCoords,
  440.                     Fixed *baseWidths, Fixed *resultWidth, Fixed *resultCoords)
  441. {
  442.     if (!ATMOpen)
  443.         return ATM_NOT_ON;
  444.     return ATMOpenVersion >= ATMProcs5Version ? 
  445. #if CALL_PASCAL
  446.         CallPascalW(method, TargetWidth, beginCoords, baseWidths, resultWidth, resultCoords,
  447.                         ATMProcs.copyFit) 
  448. #else
  449.         (*ATMProcs.copyFit)(method, TargetWidth, beginCoords, baseWidths, resultWidth, resultCoords) 
  450. #endif
  451.             : ATM_WRONG_VERSION;
  452. }
  453.  
  454. ATMErr showTextDesignATM(StringPtr fontFamily, Byte *text, short len, ATMFixedMatrix *matrix,
  455.                 Fixed *coords, Fixed *displacements, short *lenDisplayed)
  456. {
  457.     if (!ATMOpen)
  458.         return ATM_NOT_ON;
  459.     return ATMOpenVersion >= ATMProcs5Version ? 
  460. #if CALL_PASCAL
  461.         CallPascalW(fontFamily, text, len, matrix, coords, displacements, lenDisplayed,
  462.                         ATMProcs.showTextDesign) 
  463. #else
  464.         (*ATMProcs.showTextDesign)(fontFamily, text, len, matrix, coords, displacements, lenDisplayed) 
  465. #endif
  466.             : ATM_WRONG_VERSION;
  467. }
  468.  
  469. ATMErr getAxisBlendInfoATM(short axis, short *userMin, short *userMax, StringPtr axisType,
  470.                     StringPtr axisLabel, StringPtr axisShortLabel)
  471. {
  472.     if (!ATMOpen)
  473.         return ATM_NOT_ON;
  474.     return ATMOpenVersion >= ATMProcs5Version ? 
  475. #if CALL_PASCAL
  476.         CallPascalW(axis, userMin, userMax, axisType, axisLabel, axisShortLabel,
  477.                         ATMProcs.getAxisBlendInfo) 
  478. #else
  479.         (*ATMProcs.getAxisBlendInfo)(axis, userMin, userMax, axisType, axisLabel, axisShortLabel) 
  480. #endif
  481.             : ATM_WRONG_VERSION;
  482. }
  483.  
  484. ATMErr getFontSpecsATM(FontSpecs *specs)
  485. {
  486.     if (!ATMOpen)
  487.         return ATM_NOT_ON;
  488.     return ATMOpenVersion >= ATMProcs5Version ? 
  489. #if CALL_PASCAL
  490.         CallPascalW(specs, ATMProcs.getFontSpecs) 
  491. #else
  492.         (*ATMProcs.getFontSpecs)(specs) 
  493. #endif
  494.             : ATM_WRONG_VERSION;
  495. }
  496.  
  497. ATMErr fontFitATM(Fixed *origCoords, short numTargets, short *varyAxes,
  498.                 Fixed *targetMetrics, Fixed **masterMetrics,
  499.                 Fixed *retCoords, Fixed *retWeightVector)
  500. {
  501.     if (!ATMOpen)
  502.         return ATM_NOT_ON;
  503.     return ATMOpenVersion >= ATMProcs5Version ? 
  504. #if CALL_PASCAL
  505.         CallPascalW(origCoords, numTargets, varyAxes, targetMetrics,
  506.             masterMetrics, retCoords, retWeightVector,
  507.                         ATMProcs.fontFit) 
  508. #else
  509.         (*ATMProcs.fontFit)(origCoords, numTargets, varyAxes, targetMetrics,
  510.             masterMetrics, retCoords, retWeightVector) 
  511. #endif
  512.             : ATM_WRONG_VERSION;
  513. }
  514.  
  515. ATMErr        getNumBlessedFontsATM(short *numBlessedFonts)
  516. {
  517.     if (!ATMOpen)
  518.         return ATM_NOT_ON;
  519.     return ATMOpenVersion >= ATMProcs5Version ? 
  520. #if CALL_PASCAL
  521.         CallPascalW(numBlessedFonts, ATMProcs.getNumBlessedFonts) 
  522. #else
  523.         (*ATMProcs.getNumBlessedFonts)(numBlessedFonts) 
  524. #endif
  525.             : ATM_WRONG_VERSION;
  526. }
  527.  
  528. ATMErr        getBlessedFontNameATM(short i, StringPtr blessedFontName, Fixed *coords)
  529. {
  530.     if (!ATMOpen)
  531.         return ATM_NOT_ON;
  532.     return ATMOpenVersion >= ATMProcs5Version ? 
  533. #if CALL_PASCAL
  534.         CallPascalW(i, blessedFontName, coords, ATMProcs.getBlessedFontName) 
  535. #else
  536.         (*ATMProcs.getBlessedFontName)(i, blessedFontName, coords) 
  537. #endif
  538.             : ATM_WRONG_VERSION;
  539. }
  540.  
  541. ATMErr        getRegularBlessedFontATM(short *regularID)
  542. {
  543.     if (!ATMOpen)
  544.         return ATM_NOT_ON;
  545.     return ATMOpenVersion >= ATMProcs5Version ? 
  546. #if CALL_PASCAL
  547.         CallPascalW(regularID, ATMProcs.getRegularBlessedFont) 
  548. #else
  549.         (*ATMProcs.getRegularBlessedFont)(regularID) 
  550. #endif
  551.             : ATM_WRONG_VERSION;
  552. }
  553.  
  554. ATMErr        flushCacheATM(void)
  555. {
  556.     if (!ATMOpen)
  557.         return ATM_NOT_ON;
  558.     return ATMOpenVersion >= ATMProcs5Version ? 
  559. #if CALL_PASCAL
  560.         CallPascalW(ATMProcs.flushCache) 
  561. #else
  562.         (*ATMProcs.flushCache)() 
  563. #endif
  564.             : ATM_WRONG_VERSION;
  565. }
  566.  
  567. ATMErr        getFontFamilyFONDATM(StringPtr familyName, short *retFondID)
  568. {
  569.     if (!ATMOpen)
  570.         return ATM_NOT_ON;
  571.     return ATMOpenVersion >= ATMProcs5Version ? 
  572. #if CALL_PASCAL
  573.         CallPascalW(familyName, retFondID, ATMProcs.getFontFamilyFOND) 
  574. #else
  575.         (*ATMProcs.getFontFamilyFOND)(familyName, retFondID) 
  576. #endif
  577.             : ATM_WRONG_VERSION;
  578. }
  579.  
  580. ATMErr        MMFontPickerATM(struct MMFP_Parms *parms, struct MMFP_Reply *reply)
  581. {
  582.     if (!ATMOpen)
  583.         return ATM_NOT_ON;
  584.     return ATMOpenVersion >= ATMProcs5Version ? 
  585. #if CALL_PASCAL
  586.         CallPascalW(parms, reply, ATMProcs.MMFontPicker) 
  587. #else
  588.         (*ATMProcs.MMFontPicker)(parms, reply) 
  589. #endif
  590.             : ATM_WRONG_VERSION;
  591. }
  592.  
  593. Boolean isSubstFontATM(StringPtr fontName, short fondID, short style, FontSpecs ***fontSpecs, Handle *chamName)
  594. {
  595.     if (!ATMOpen)
  596.         return FALSE;
  597.     return ATMOpenVersion >= ATMProcs8Version ? 
  598. #if CALL_PASCAL
  599.         CallPascalB(fontName, fondID, style, fontSpecs, chamName, ATMProcs.isSubstFont)
  600. #else
  601.         (*ATMProcs.isSubstFont)(fontName, fondID, style, fontSpecs, chamName) 
  602. #endif
  603.          : FALSE;
  604. }
  605.  
  606. ATMErr getPSNumATM(StringPtr psName, short *retFondID, Boolean doCreate)
  607. {
  608.     if (!ATMOpen)
  609.         return ATM_NOT_ON;
  610.     return ATMOpenVersion >= ATMProcs8Version ?
  611. #if CALL_PASCAL
  612.         CallPascalW(psName, retFondID, doCreate, ATMProcs.getPSNum) 
  613. #else
  614.         (*ATMProcs.getPSNum)(psName, retFondID, doCreate) 
  615. #endif
  616.             : ATM_WRONG_VERSION;
  617. }
  618.